package com.taobao.api.request;

import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.TaobaoObject;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.json.JSONWriter;
import com.taobao.api.response.CainiaoSmartdeliveryPriceofferIUpdateResponse;

/**
 * TOP API: cainiao.smartdelivery.priceoffer.i.update request
 * 
 * @author top auto create
 * @since 1.0, 2018.07.25
 */
public class CainiaoSmartdeliveryPriceofferIUpdateRequest extends BaseTaobaoRequest<CainiaoSmartdeliveryPriceofferIUpdateResponse> {
	
	

	/** 
	* 物流公司价格信息
	 */
	private String cpPriceInfo;

	public void setCpPriceInfo(String cpPriceInfo) {
		this.cpPriceInfo = cpPriceInfo;
	}

	public void setCpPriceInfo(CpPriceInfo cpPriceInfo) {
		this.cpPriceInfo = new JSONWriter(false,true).write(cpPriceInfo);
	}

	public String getCpPriceInfo() {
		return this.cpPriceInfo;
	}

	public String getApiMethodName() {
		return "cainiao.smartdelivery.priceoffer.i.update";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("cp_price_info", this.cpPriceInfo);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<CainiaoSmartdeliveryPriceofferIUpdateResponse> getResponseClass() {
		return CainiaoSmartdeliveryPriceofferIUpdateResponse.class;
	}

	public void check() throws ApiRuleException {
	}
	
	/**
 * 发货地址
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class Address extends TaobaoObject {

	private static final long serialVersionUID = 3574175663757575467L;

	/**
		 * 市
		 */
		@ApiField("city")
		private String city;
		/**
		 * 详细地址
		 */
		@ApiField("detail")
		private String detail;
		/**
		 * 区
		 */
		@ApiField("district")
		private String district;
		/**
		 * 省
		 */
		@ApiField("province")
		private String province;
		/**
		 * 街道
		 */
		@ApiField("town")
		private String town;
	

	public String getCity() {
			return this.city;
		}
		public void setCity(String city) {
			this.city = city;
		}
		public String getDetail() {
			return this.detail;
		}
		public void setDetail(String detail) {
			this.detail = detail;
		}
		public String getDistrict() {
			return this.district;
		}
		public void setDistrict(String district) {
			this.district = district;
		}
		public String getProvince() {
			return this.province;
		}
		public void setProvince(String province) {
			this.province = province;
		}
		public String getTown() {
			return this.town;
		}
		public void setTown(String town) {
			this.town = town;
		}

}

	/**
 * 成本报价
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class CostPrice extends TaobaoObject {

	private static final long serialVersionUID = 4816439132351179381L;

	/**
		 * 续重价格，单位分
		 */
		@ApiField("continus_measure_price")
		private Long continusMeasurePrice;
		/**
		 * 续重，单位g
		 */
		@ApiField("continus_measure_weight")
		private Long continusMeasureWeight;
		/**
		 * 首重价格，单位分
		 */
		@ApiField("first_measure_price")
		private Long firstMeasurePrice;
		/**
		 * 首重，单位g
		 */
		@ApiField("first_measure_weight")
		private Long firstMeasureWeight;
	

	public Long getContinusMeasurePrice() {
			return this.continusMeasurePrice;
		}
		public void setContinusMeasurePrice(Long continusMeasurePrice) {
			this.continusMeasurePrice = continusMeasurePrice;
		}
		public Long getContinusMeasureWeight() {
			return this.continusMeasureWeight;
		}
		public void setContinusMeasureWeight(Long continusMeasureWeight) {
			this.continusMeasureWeight = continusMeasureWeight;
		}
		public Long getFirstMeasurePrice() {
			return this.firstMeasurePrice;
		}
		public void setFirstMeasurePrice(Long firstMeasurePrice) {
			this.firstMeasurePrice = firstMeasurePrice;
		}
		public Long getFirstMeasureWeight() {
			return this.firstMeasureWeight;
		}
		public void setFirstMeasureWeight(Long firstMeasureWeight) {
			this.firstMeasureWeight = firstMeasureWeight;
		}

}

	/**
 * 适用重量范围
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class WeightRange extends TaobaoObject {

	private static final long serialVersionUID = 4578156768837454214L;

	/**
		 * 最小限制重量
		 */
		@ApiField("lower_limit_weight")
		private Long lowerLimitWeight;
		/**
		 * 最大限制重量
		 */
		@ApiField("upper_limit_weight")
		private Long upperLimitWeight;
	

	public Long getLowerLimitWeight() {
			return this.lowerLimitWeight;
		}
		public void setLowerLimitWeight(Long lowerLimitWeight) {
			this.lowerLimitWeight = lowerLimitWeight;
		}
		public Long getUpperLimitWeight() {
			return this.upperLimitWeight;
		}
		public void setUpperLimitWeight(Long upperLimitWeight) {
			this.upperLimitWeight = upperLimitWeight;
		}

}

	/**
 * 报价规则
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class PriceRule extends TaobaoObject {

	private static final long serialVersionUID = 8232817772268178225L;

	/**
		 * 成本报价
		 */
		@ApiField("cost_price")
		private CostPrice costPrice;
		/**
		 * 适用重量范围
		 */
		@ApiField("weight_range")
		private WeightRange weightRange;
	

	public CostPrice getCostPrice() {
			return this.costPrice;
		}
		public void setCostPrice(CostPrice costPrice) {
			this.costPrice = costPrice;
		}
		public WeightRange getWeightRange() {
			return this.weightRange;
		}
		public void setWeightRange(WeightRange weightRange) {
			this.weightRange = weightRange;
		}

}

	/**
 * 到货地区
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class AddressArea extends TaobaoObject {

	private static final long serialVersionUID = 3746231646526691621L;

	/**
		 * 市
		 */
		@ApiField("city")
		private String city;
		/**
		 * 对于全国统一价格的，不需要设置省市区信息，只需要填写国家为中国即可：表明发往全国的价格，目前仅支持填写中国
		 */
		@ApiField("country")
		private String country;
		/**
		 * 区
		 */
		@ApiField("district")
		private String district;
		/**
		 * 省
		 */
		@ApiField("province")
		private String province;
	

	public String getCity() {
			return this.city;
		}
		public void setCity(String city) {
			this.city = city;
		}
		public String getCountry() {
			return this.country;
		}
		public void setCountry(String country) {
			this.country = country;
		}
		public String getDistrict() {
			return this.district;
		}
		public void setDistrict(String district) {
			this.district = district;
		}
		public String getProvince() {
			return this.province;
		}
		public void setProvince(String province) {
			this.province = province;
		}

}

	/**
 * 报价列表
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class PriceOffer extends TaobaoObject {

	private static final long serialVersionUID = 7657445633894614325L;

	/**
		 * 报价规则
		 */
		@ApiListField("price_rule_list")
		@ApiField("price_rule")
		private List<PriceRule> priceRuleList;
		/**
		 * 到货地区
		 */
		@ApiField("receive_area")
		private AddressArea receiveArea;
	

	public List<PriceRule> getPriceRuleList() {
			return this.priceRuleList;
		}
		public void setPriceRuleList(List<PriceRule> priceRuleList) {
			this.priceRuleList = priceRuleList;
		}
		public AddressArea getReceiveArea() {
			return this.receiveArea;
		}
		public void setReceiveArea(AddressArea receiveArea) {
			this.receiveArea = receiveArea;
		}

}

	/**
 * 物流公司价格信息
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class CpPriceInfo extends TaobaoObject {

	private static final long serialVersionUID = 1872758649881628862L;

	/**
		 * 物流公司编码
		 */
		@ApiField("cp_code")
		private String cpCode;
		/**
		 * 报价列表
		 */
		@ApiListField("price_offer_list")
		@ApiField("price_offer")
		private List<PriceOffer> priceOfferList;
		/**
		 * 发货地址
		 */
		@ApiField("send_address")
		private Address sendAddress;
		/**
		 * 仓id
		 */
		@ApiField("warehouse_id")
		private Long warehouseId;
	

	public String getCpCode() {
			return this.cpCode;
		}
		public void setCpCode(String cpCode) {
			this.cpCode = cpCode;
		}
		public List<PriceOffer> getPriceOfferList() {
			return this.priceOfferList;
		}
		public void setPriceOfferList(List<PriceOffer> priceOfferList) {
			this.priceOfferList = priceOfferList;
		}
		public Address getSendAddress() {
			return this.sendAddress;
		}
		public void setSendAddress(Address sendAddress) {
			this.sendAddress = sendAddress;
		}
		public Long getWarehouseId() {
			return this.warehouseId;
		}
		public void setWarehouseId(Long warehouseId) {
			this.warehouseId = warehouseId;
		}

}


}